Page({
  data: {
    pageTotal: 0,
    total: 0,
    rows: []
  },
  goDetail(e) {
    const id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: `/repair_pkg/pages/detail/index?id=${id}`,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
  async onShow() {
    const {
      data: {
        pageTotal,
        total,
        rows
      }
    } = await wx.http.get('/repair')
    this.setData({
      pageTotal,
      total,
      rows
    })
  }
})